package com.yonder.firstpage;

import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.request.mapper.parameter.PageParameters;

import com.yonder.SimpleSession;
import com.yonder.detail.Detail;
import com.yonder.signout.SignOut;

@AuthorizeInstantiation("GOD")
public class FirstPage extends WebPage {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5757813923534982914L;

	public FirstPage(PageParameters parameters) {
		super(parameters);
		String username = ((SimpleSession) getSession()).getUsername();
		add(new Label("usernameLbl", username));
		add(new Link<Void>("detailslink") {

			/**
			 * 
			 */
			private static final long serialVersionUID = 6126339323142447511L;

			@Override
			public void onClick() {
				setResponsePage(Detail.class);
			}

		});
		add(new Link<Void>("signoutlink") {

			/**
			 * 
			 */
			private static final long serialVersionUID = 6126339323142447511L;

			@Override
			public void onClick() {
				setResponsePage(SignOut.class);
			}

		});
	}
}
